<!DOCTYPE html>
<svg>
  <defs>
    <pattern width="100" height="100" id="ref_pattern1" patternUnits="userSpaceOnUse">
      <rect width="100" height="100" fill="red"/>
    </pattern>
    <pattern href="#ref_pattern1" id="pattern1"></pattern>
  </defs>
  <rect width="100" height="100" fill="url(#pattern1) green"/>
</svg>
<script>
document.addEventListener("DOMContentLoaded", function() {
  document.documentElement.offsetTop;

  let ref_pattern1 = document.getElementById("ref_pattern1");
  ref_pattern1.style.display = "inline-block";

  let pattern1 = document.getElementById("pattern1");
  pattern1.removeAttribute('href');
}, false);
</script>
